PMD is a static ruleset based Java source code analyzer that identifies potential problems like:
While PMD doesn't officially stand for anything, it has several unofficial names, the most appropriate probably being Programming Mistake Detector.
Typically, PMD errors are not true errors, but rather inefficient code, i.e. the application could still function properly even if they were not corrected.
Contents |
PMD includes a set of built-in rules and supports the ability to write custom rules. The custom rules can be written in two ways:
1. Using XPath
2. Using Java classes
The Copy/Paste Detector (CPD) is an add-on to PMD that uses the Rabin–Karp string search algorithm to find duplicated code. CPD works with Java, JSP, C, C++, Fortran and PHP code.
PMD has plugins for JDeveloper, Eclipse, JEdit, JBuilder, Omnicore's CodeGuide, NetBeans/Sun Studio, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, Hudson, Jenkins, Sonar and Emacs.